<?php

Header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
Header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past  
Header('Pragma: no-cache');

set_time_limit(0);

for ($i = 0; $i < 1000; $i++) {
    usleep(1);
    $url = "http://testphpapp.applinzi.com/index.php";
    $post_data = array("newvoteitem" => "bob->$i", "submit1" => "添 加");
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    // post数据
    curl_setopt($ch, CURLOPT_POST, 1);
    // post的变量
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    $output = curl_exec($ch);
    curl_close($ch);
}
echo "所有线程派发完毕,等待执行完成.\n";
echo "所有线程执行完毕.\n";
